home *** CD-ROM | disk | FTP | other *** search
- /*
- File: TestInterruptSafeDebug.c
-
- Contains: Test program for the InterruptSafeDebug library.
-
- Written by: Quinn "The Eskimo!"
-
- Copyright: © 1998 by Apple Computer, Inc., all rights reserved.
-
- You may incorporate this Apple sample source code into your program(s) without
- restriction. This Apple sample source code has been provided "AS IS" and the
- responsibility for its operation is yours. You are not permitted to redistribute
- this Apple sample source code as "Apple sample source code" after having made
- changes. If you're going to re-distribute the source, we require that you make
- it clear in the source that the code was descended from Apple sample source
- code, but that you've made changes.
-
- Change History (most recent first):
-
- <1> 23/11/98 Quinn First checked in.
- */
-
- /////////////////////////////////////////////////////////////////////
-
- // Setup MoreIsBetter environment
-
- #include "MoreSetup.h"
-
- // Standard Mac OS interfaces
-
- #include <MacTypes.h>
-
- // Standard C interfaces
-
- #include <stdio.h>
- #include <string.h>
-
- // Module to be tested
-
- #include "InterruptSafeDebug.h"
-
- /////////////////////////////////////////////////////////////////////
-
- void main(void)
- {
- OSStatus err;
- ItemCount i;
-
- printf("Hello Cruel World!\n");
- fflush(stdout);
-
- err = InitInterruptSafeDebug();
- if (err == noErr) {
-
- ISdebugstr("Hello Cruel World!");
-
- for (i = 0; i < 256; i++) {
- ISDebugChar(i);
- }
- for (i = 0; i < 100; i++) {
- ISDebugStr("\pHello Cruel World");
- }
-
- ISDebugText( (UInt8 *) "ISDebugText", strlen("ISDebugText"));
- ISdebugstr ("ISdebugstr");
- }
-
- if (err == noErr) {
- printf("Success\n");
- } else {
- printf("Failed with error %ld.\n", err);
- }
- printf("Done. Press command-Q to Quit.\n");
- }
-